{if !$loggedIn}
	{if $auth->accessTo("authentication")}
		<div id="modals">
			<div id="tekst">
				{display_errors errors="$errors" width="300px"}
				<h3>Log hieronder s.v.p. in</h3>
				<form method="post" action="{$REQUEST_URI}" id="form_login">
				<table border="0" class="body5">
				  <tr>
				    <td colspan="2">
						<p>{if isset($messages) && count($messages) > 0}Sorry, het volgende is fout gegaan:{/if}</p>
						<ul>
						{if isset($messages) && count($messages) > 0}
							{foreach from=$messages item=message}
								<li>{$message}</li>
							{/foreach}
						{/if}
						</ul>
				    </td>
				  </tr>
					<tr>
						<td><label for="rijschool">Rijschool code</label>:</td>
						<td><input class="submit4" type="text" id="rijschool" name="rijschool" style="width:200px;" value="{if $smarty.post.rijschool|count_characters >0}{$smarty.post.rijschool}{elseif $handle_redirect|count_characters >0}{$handle_redirect}{/if}" /></td>
					</tr>
					<tr>
						<td><label for="email">E-mailadres</label>:</td>
						<td><input class="submit4" type="text" id="email" name="email" style="width:200px;" value="{$smarty.post.email}"/></td>
					</tr>
					<tr>
						<td><label for="password">Password</label>:</td>
						<td><input class="submit4" type="password" id="password" name="password" style="width:200px;" value="{$smarty.post.password}"/></td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<input type="hidden" name="module" value="authentication" />
							<input type="hidden" name="action" value="login" />
							<input type="hidden" name="referer" value="{$REQUEST_URI}" />
							<input type="submit" value="Login" class="submit5" />
						</td>
					</tr>
				</table>
				</form>
			</div>
		</div>
	{else}
		<h3>Je hebt geen rechten om in te loggen</h3>
	{/if}
{else}
	{if isset($loginAction)}
		<a href="/rijlesplanner">Naar de homepage</a>
		<script type="text/javascript">
		setTimeout("document.location.href = '{$referer}'", 500);
		</script>
	{/if}
{/if}